cmake_minimum_required(VERSION 2.8)
project(ffmpeg_project)

# remove -g flag if you want to build release
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -fomit-frame-pointer -pthread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -Wno-maybe-uninitialized")
message("c flags:\n"  ${CMAKE_C_FLAGS})

add_definitions( 
    -D_ISOC99_SOURCE
    -D_FILE_OFFSET_BITS=64
    -D_LARGEFILE_SOURCE
    -D_POSIX_C_SOURCE=200112
    -D_XOPEN_SOURCE=600
    -DZLIB_CONST
    -DHAVE_AV_CONFIG_H
)

include_directories(
    ./
    ./compat/atomics/gcc
)

list(APPEND avfilter_srcs
    libavfilter/aeval.c
    libavfilter/af_acontrast.c
    libavfilter/af_acopy.c
    libavfilter/af_acrossover.c
    libavfilter/af_acrusher.c
    libavfilter/af_adeclick.c
    libavfilter/af_adelay.c
    libavfilter/af_aderivative.c
    libavfilter/af_aecho.c
    libavfilter/af_aemphasis.c
    libavfilter/af_afade.c
    libavfilter/af_afftdn.c
    libavfilter/af_afftfilt.c
    libavfilter/af_afir.c
    libavfilter/af_aformat.c
    libavfilter/af_agate.c
    libavfilter/af_aiir.c
    libavfilter/af_alimiter.c
    libavfilter/af_amerge.c
    libavfilter/af_amix.c
    libavfilter/af_amultiply.c
    libavfilter/af_anequalizer.c
    libavfilter/af_anull.c
    libavfilter/af_apad.c
    libavfilter/af_aphaser.c
    libavfilter/af_apulsator.c
    libavfilter/af_aresample.c
    libavfilter/af_asetnsamples.c
    libavfilter/af_asetrate.c
    libavfilter/af_ashowinfo.c
    libavfilter/af_astats.c
    libavfilter/af_atempo.c
    libavfilter/af_biquads.c
    libavfilter/af_channelmap.c
    libavfilter/af_channelsplit.c
    libavfilter/af_chorus.c
    libavfilter/af_compand.c
    libavfilter/af_compensationdelay.c
    libavfilter/af_crossfeed.c
    libavfilter/af_crystalizer.c
    libavfilter/af_dcshift.c
    libavfilter/af_drmeter.c
    libavfilter/af_dynaudnorm.c
    libavfilter/af_earwax.c
    libavfilter/af_extrastereo.c
    libavfilter/af_firequalizer.c
    libavfilter/af_flanger.c
    libavfilter/af_haas.c
    libavfilter/af_hdcd.c
    libavfilter/af_headphone.c
    libavfilter/af_join.c
    libavfilter/af_loudnorm.c
    libavfilter/af_mcompand.c
    libavfilter/af_pan.c
    libavfilter/af_replaygain.c
    libavfilter/af_sidechaincompress.c
    libavfilter/af_silencedetect.c
    libavfilter/af_silenceremove.c
    libavfilter/af_stereotools.c
    libavfilter/af_stereowiden.c
    libavfilter/af_superequalizer.c
    libavfilter/af_surround.c
    libavfilter/af_tremolo.c
    libavfilter/af_vibrato.c
    libavfilter/af_volume.c
    libavfilter/af_volumedetect.c
    libavfilter/allfilters.c
    libavfilter/asink_anullsink.c
    libavfilter/asrc_anoisesrc.c
    libavfilter/asrc_anullsrc.c
    libavfilter/asrc_hilbert.c
    libavfilter/asrc_sinc.c
    libavfilter/asrc_sine.c
    libavfilter/audio.c
    libavfilter/avf_abitscope.c
    libavfilter/avf_ahistogram.c
    libavfilter/avf_aphasemeter.c
    libavfilter/avf_avectorscope.c
    libavfilter/avf_concat.c
    libavfilter/avf_showcqt.c
    libavfilter/avf_showfreqs.c
    libavfilter/avf_showspectrum.c
    libavfilter/avf_showvolume.c
    libavfilter/avf_showwaves.c
    libavfilter/avfilter.c
    libavfilter/avfiltergraph.c
    libavfilter/bbox.c
    libavfilter/boxblur.c
    libavfilter/buffersink.c
    libavfilter/buffersrc.c
    libavfilter/colorspace.c
    libavfilter/colorspacedsp.c
    libavfilter/dnn_backend_native.c
    libavfilter/dnn_interface.c
    libavfilter/drawutils.c
    libavfilter/ebur128.c
    libavfilter/f_bench.c
    libavfilter/f_cue.c
    libavfilter/f_drawgraph.c
    libavfilter/f_ebur128.c
    libavfilter/f_graphmonitor.c
    libavfilter/f_interleave.c
    libavfilter/f_loop.c
    libavfilter/f_metadata.c
    libavfilter/f_perms.c
    libavfilter/f_realtime.c
    libavfilter/f_reverse.c
    libavfilter/f_select.c
    libavfilter/f_sendcmd.c
    libavfilter/f_sidedata.c
    libavfilter/f_streamselect.c
    libavfilter/fifo.c
    libavfilter/formats.c
    libavfilter/framepool.c
    libavfilter/framequeue.c
    libavfilter/framesync.c
    libavfilter/generate_wave_table.c
    libavfilter/graphdump.c
    libavfilter/graphparser.c
    libavfilter/lavfutils.c
    libavfilter/lswsutils.c
    libavfilter/motion_estimation.c
    libavfilter/pthread.c
    libavfilter/scale.c
    libavfilter/setpts.c
    libavfilter/settb.c
    libavfilter/split.c
    libavfilter/src_movie.c
    libavfilter/transform.c
    libavfilter/trim.c
    libavfilter/vaf_spectrumsynth.c
    libavfilter/vf_alphamerge.c
    libavfilter/vf_amplify.c
    libavfilter/vf_aspect.c
    libavfilter/vf_atadenoise.c
    libavfilter/vf_avgblur.c
    libavfilter/vf_bbox.c
    libavfilter/vf_bitplanenoise.c
    libavfilter/vf_blackdetect.c
    libavfilter/vf_blackframe.c
    libavfilter/vf_blend.c
    libavfilter/vf_bm3d.c
    libavfilter/vf_boxblur.c
    libavfilter/vf_bwdif.c
    libavfilter/vf_chromakey.c
    libavfilter/vf_ciescope.c
    libavfilter/vf_codecview.c
    libavfilter/vf_colorbalance.c
    libavfilter/vf_colorchannelmixer.c
    libavfilter/vf_colorconstancy.c
    libavfilter/vf_colorkey.c
    libavfilter/vf_colorlevels.c
    libavfilter/vf_colormatrix.c
    libavfilter/vf_colorspace.c
    libavfilter/vf_convolution.c
    libavfilter/vf_convolve.c
    libavfilter/vf_copy.c
    libavfilter/vf_cover_rect.c
    libavfilter/vf_crop.c
    libavfilter/vf_cropdetect.c
    libavfilter/vf_curves.c
    libavfilter/vf_datascope.c
    libavfilter/vf_dctdnoiz.c
    libavfilter/vf_deband.c
    libavfilter/vf_deblock.c
    libavfilter/vf_decimate.c
    libavfilter/vf_deflicker.c
    libavfilter/vf_dejudder.c
    libavfilter/vf_delogo.c
    libavfilter/vf_deshake.c
    libavfilter/vf_despill.c
    libavfilter/vf_detelecine.c
    libavfilter/vf_displace.c
    libavfilter/vf_drawbox.c
    libavfilter/vf_edgedetect.c
    libavfilter/vf_elbg.c
    libavfilter/vf_entropy.c
    libavfilter/vf_eq.c
    libavfilter/vf_extractplanes.c
    libavfilter/vf_fade.c
    libavfilter/vf_fftdnoiz.c
    libavfilter/vf_fftfilt.c
    libavfilter/vf_field.c
    libavfilter/vf_fieldhint.c
    libavfilter/vf_fieldmatch.c
    libavfilter/vf_fieldorder.c
    libavfilter/vf_fillborders.c
    libavfilter/vf_find_rect.c
    libavfilter/vf_floodfill.c
    libavfilter/vf_format.c
    libavfilter/vf_fps.c
    libavfilter/vf_framepack.c
    libavfilter/vf_framerate.c
    libavfilter/vf_framestep.c
    libavfilter/vf_fspp.c
    libavfilter/vf_gblur.c
    libavfilter/vf_geq.c
    libavfilter/vf_gradfun.c
    libavfilter/vf_hflip.c
    libavfilter/vf_histeq.c
    libavfilter/vf_histogram.c
    libavfilter/vf_hqdn3d.c
    libavfilter/vf_hqx.c
    libavfilter/vf_hue.c
    libavfilter/vf_hwdownload.c
    libavfilter/vf_hwmap.c
    libavfilter/vf_hwupload.c
    libavfilter/vf_hysteresis.c
    libavfilter/vf_idet.c
    libavfilter/vf_il.c
    libavfilter/vf_kerndeint.c
    libavfilter/vf_lenscorrection.c
    libavfilter/vf_limiter.c
    libavfilter/vf_lumakey.c
    libavfilter/vf_lut.c
    libavfilter/vf_lut2.c
    libavfilter/vf_lut3d.c
    libavfilter/vf_maskedclamp.c
    libavfilter/vf_maskedmerge.c
    libavfilter/vf_mcdeint.c
    libavfilter/vf_mergeplanes.c
    libavfilter/vf_mestimate.c
    libavfilter/vf_midequalizer.c
    libavfilter/vf_minterpolate.c
    libavfilter/vf_mix.c
    libavfilter/vf_mpdecimate.c
    libavfilter/vf_neighbor.c
    libavfilter/vf_nlmeans.c
    libavfilter/vf_nnedi.c
    libavfilter/vf_noise.c
    libavfilter/vf_normalize.c
    libavfilter/vf_null.c
    libavfilter/vf_overlay.c
    libavfilter/vf_owdenoise.c
    libavfilter/vf_pad.c
    libavfilter/vf_palettegen.c
    libavfilter/vf_paletteuse.c
    libavfilter/vf_perspective.c
    libavfilter/vf_phase.c
    libavfilter/vf_pixdesctest.c
    libavfilter/vf_pp.c
    libavfilter/vf_pp7.c
    libavfilter/vf_premultiply.c
    libavfilter/vf_pseudocolor.c
    libavfilter/vf_psnr.c
    libavfilter/vf_pullup.c
    libavfilter/vf_qp.c
    libavfilter/vf_random.c
    libavfilter/vf_readeia608.c
    libavfilter/vf_readvitc.c
    libavfilter/vf_remap.c
    libavfilter/vf_removegrain.c
    libavfilter/vf_removelogo.c
    libavfilter/vf_repeatfields.c
    libavfilter/vf_rotate.c
    libavfilter/vf_sab.c
    libavfilter/vf_scale.c
    libavfilter/vf_selectivecolor.c
    libavfilter/vf_separatefields.c
    libavfilter/vf_setparams.c
    libavfilter/vf_showinfo.c
    libavfilter/vf_showpalette.c
    libavfilter/vf_shuffleframes.c
    libavfilter/vf_shuffleplanes.c
    libavfilter/vf_signalstats.c
    libavfilter/vf_signature.c
    libavfilter/vf_smartblur.c
    libavfilter/vf_spp.c
    libavfilter/vf_sr.c
    libavfilter/vf_ssim.c
    libavfilter/vf_stack.c
    libavfilter/vf_stereo3d.c
    libavfilter/vf_super2xsai.c
    libavfilter/vf_swaprect.c
    libavfilter/vf_swapuv.c
    libavfilter/vf_telecine.c
    libavfilter/vf_threshold.c
    libavfilter/vf_thumbnail.c
    libavfilter/vf_tile.c
    libavfilter/vf_tinterlace.c
    libavfilter/vf_tonemap.c
    libavfilter/vf_transpose.c
    libavfilter/vf_unsharp.c
    libavfilter/vf_uspp.c
    libavfilter/vf_vaguedenoiser.c
    libavfilter/vf_vectorscope.c
    libavfilter/vf_vflip.c
    libavfilter/vf_vfrdet.c
    libavfilter/vf_vibrance.c
    libavfilter/vf_vignette.c
    libavfilter/vf_vmafmotion.c
    libavfilter/vf_w3fdif.c
    libavfilter/vf_waveform.c
    libavfilter/vf_weave.c
    libavfilter/vf_xbr.c
    libavfilter/vf_yadif.c
    libavfilter/vf_zoompan.c
    libavfilter/video.c
    libavfilter/vsink_nullsink.c
    libavfilter/vsrc_cellauto.c
    libavfilter/vsrc_life.c
    libavfilter/vsrc_mandelbrot.c
    libavfilter/vsrc_mptestsrc.c
    libavfilter/vsrc_testsrc.c
    libavfilter/yadif_common.c
)

list(APPEND avformat_srcs
    libavformat/3dostr.c
    libavformat/4xm.c
    libavformat/a64.c
    libavformat/aacdec.c
    libavformat/aadec.c
    libavformat/ac3dec.c
    libavformat/acm.c
    libavformat/act.c
    libavformat/adp.c
    libavformat/ads.c
    libavformat/adtsenc.c
    libavformat/adxdec.c
    libavformat/aea.c
    libavformat/afc.c
    libavformat/aiffdec.c
    libavformat/aiffenc.c
    libavformat/aixdec.c
    libavformat/allformats.c
    libavformat/amr.c
    libavformat/anm.c
    libavformat/apc.c
    libavformat/ape.c
    libavformat/apetag.c
    libavformat/apngdec.c
    libavformat/apngenc.c
    libavformat/aptxdec.c
    libavformat/aqtitledec.c
    libavformat/asf.c
    libavformat/asfcrypt.c
    libavformat/asfdec_f.c
    libavformat/asfdec_o.c
    libavformat/asfenc.c
    libavformat/assdec.c
    libavformat/assenc.c
    libavformat/ast.c
    libavformat/astdec.c
    libavformat/astenc.c
    libavformat/async.c
    libavformat/au.c
    libavformat/audiointerleave.c
    libavformat/av1.c
    libavformat/avc.c
    libavformat/avidec.c
    libavformat/avienc.c
    libavformat/avio.c
    libavformat/aviobuf.c
    libavformat/avlanguage.c
    libavformat/avr.c
    libavformat/avs.c
    libavformat/bethsoftvid.c
    libavformat/bfi.c
    libavformat/bink.c
    libavformat/bintext.c
    libavformat/bit.c
    libavformat/bmv.c
    libavformat/boadec.c
    libavformat/brstm.c
    libavformat/c93.c
    libavformat/cache.c
    libavformat/caf.c
    libavformat/cafdec.c
    libavformat/cafenc.c
    libavformat/cavsvideodec.c
    libavformat/cdg.c
    libavformat/cdxl.c
    libavformat/cinedec.c
    libavformat/codec2.c
    libavformat/concat.c
    libavformat/concatdec.c
    libavformat/crcenc.c
    libavformat/crypto.c
    libavformat/cutils.c
    libavformat/dash.c
    libavformat/dashenc.c
    libavformat/data_uri.c
    libavformat/dauddec.c
    libavformat/daudenc.c
    libavformat/davs2.c
    libavformat/dcstr.c
    libavformat/dfa.c
    libavformat/diracdec.c
    libavformat/dnxhddec.c
    libavformat/dsfdec.c
    libavformat/dsicin.c
    libavformat/dss.c
    libavformat/dtsdec.c
    libavformat/dtshddec.c
    libavformat/dump.c
    libavformat/dv.c
    libavformat/dvbsub.c
    libavformat/dvbtxt.c
    libavformat/dvenc.c
    libavformat/dxa.c
    libavformat/eacdata.c
    libavformat/electronicarts.c
    libavformat/epafdec.c
    libavformat/ffmetadec.c
    libavformat/ffmetaenc.c
    libavformat/fifo.c
    libavformat/fifo_test.c
    libavformat/file.c
    libavformat/filmstripdec.c
    libavformat/filmstripenc.c
    libavformat/fitsdec.c
    libavformat/fitsenc.c
    libavformat/flac_picture.c
    libavformat/flacdec.c
    libavformat/flacenc.c
    libavformat/flacenc_header.c
    libavformat/flic.c
    libavformat/flvdec.c
    libavformat/flvenc.c
    libavformat/format.c
    libavformat/framecrcenc.c
    libavformat/framehash.c
    libavformat/frmdec.c
    libavformat/fsb.c
    libavformat/ftp.c
    libavformat/g722.c
    libavformat/g723_1.c
    libavformat/g726.c
    libavformat/g729dec.c
    libavformat/gdv.c
    libavformat/genh.c
    libavformat/gif.c
    libavformat/gifdec.c
    libavformat/gopher.c
    libavformat/gsmdec.c
    libavformat/gxf.c
    libavformat/gxfenc.c
    libavformat/h261dec.c
    libavformat/h263dec.c
    libavformat/h264dec.c
    libavformat/hashenc.c
    libavformat/hdsenc.c
    libavformat/hevc.c
    libavformat/hevcdec.c
    libavformat/hls.c
    libavformat/hlsenc.c
    libavformat/hlsplaylist.c
    libavformat/hlsproto.c
    libavformat/hnm.c
    libavformat/http.c
    libavformat/httpauth.c
    libavformat/icecast.c
    libavformat/icodec.c
    libavformat/icoenc.c
    libavformat/id3v1.c
    libavformat/id3v2.c
    libavformat/id3v2enc.c
    libavformat/idcin.c
    libavformat/idroqdec.c
    libavformat/idroqenc.c
    libavformat/iff.c
    libavformat/ilbc.c
    libavformat/img2.c
    libavformat/img2_alias_pix.c
    libavformat/img2_brender_pix.c
    libavformat/img2dec.c
    libavformat/img2enc.c
    libavformat/ingenientdec.c
    libavformat/ip.c
    libavformat/ipmovie.c
    libavformat/ircam.c
    libavformat/ircamdec.c
    libavformat/ircamenc.c
    libavformat/isom.c
    libavformat/iss.c
    libavformat/iv8.c
    libavformat/ivfdec.c
    libavformat/ivfenc.c
    libavformat/jacosubdec.c
    libavformat/jacosubenc.c
    libavformat/jvdec.c
    libavformat/latmenc.c
    libavformat/lmlm4.c
    libavformat/loasdec.c
    libavformat/lrc.c
    libavformat/lrcdec.c
    libavformat/lrcenc.c
    libavformat/lvfdec.c
    libavformat/lxfdec.c
    libavformat/m4vdec.c
    libavformat/matroska.c
    libavformat/matroskadec.c
    libavformat/matroskaenc.c
    libavformat/md5proto.c
    libavformat/metadata.c
    libavformat/mgsts.c
    libavformat/microdvddec.c
    libavformat/microdvdenc.c
    libavformat/mj2kdec.c
    libavformat/mkvtimestamp_v2.c
    libavformat/mlpdec.c
    libavformat/mlvdec.c
    libavformat/mm.c
    libavformat/mmf.c
    libavformat/mms.c
    libavformat/mmsh.c
    libavformat/mmst.c
    libavformat/mov.c
    libavformat/mov_chan.c
    libavformat/mov_esds.c
    libavformat/movenc.c
    libavformat/movenccenc.c
    libavformat/movenchint.c
    libavformat/mp3dec.c
    libavformat/mp3enc.c
    libavformat/mpc.c
    libavformat/mpc8.c
    libavformat/mpeg.c
    libavformat/mpegenc.c
    libavformat/mpegts.c
    libavformat/mpegtsenc.c
    libavformat/mpegvideodec.c
    libavformat/mpjpeg.c
    libavformat/mpjpegdec.c
    libavformat/mpl2dec.c
    libavformat/mpsubdec.c
    libavformat/msf.c
    libavformat/msnwc_tcp.c
    libavformat/mtaf.c
    libavformat/mtv.c
    libavformat/musx.c
    libavformat/mux.c
    libavformat/mvdec.c
    libavformat/mvi.c
    libavformat/mxf.c
    libavformat/mxfdec.c
    libavformat/mxfenc.c
    libavformat/mxg.c
    libavformat/ncdec.c
    libavformat/network.c
    libavformat/nistspheredec.c
    libavformat/nspdec.c
    libavformat/nsvdec.c
    libavformat/nullenc.c
    libavformat/nut.c
    libavformat/nutdec.c
    libavformat/nutenc.c
    libavformat/nuv.c
    libavformat/oggdec.c
    libavformat/oggenc.c
    libavformat/oggparsecelt.c
    libavformat/oggparsedaala.c
    libavformat/oggparsedirac.c
    libavformat/oggparseflac.c
    libavformat/oggparseogm.c
    libavformat/oggparseopus.c
    libavformat/oggparseskeleton.c
    libavformat/oggparsespeex.c
    libavformat/oggparsetheora.c
    libavformat/oggparsevorbis.c
    libavformat/oggparsevp8.c
    libavformat/oma.c
    libavformat/omadec.c
    libavformat/omaenc.c
    libavformat/options.c
    libavformat/os_support.c
    libavformat/paf.c
    libavformat/pcm.c
    libavformat/pcmdec.c
    libavformat/pcmenc.c
    libavformat/pjsdec.c
    libavformat/pmpdec.c
    libavformat/prompeg.c
    libavformat/protocols.c
    libavformat/psxstr.c
    libavformat/pva.c
    libavformat/pvfdec.c
    libavformat/qcp.c
    libavformat/qtpalette.c
    libavformat/r3d.c
    libavformat/rawdec.c
    libavformat/rawenc.c
    libavformat/rawutils.c
    libavformat/rawvideodec.c
    libavformat/rdt.c
    libavformat/realtextdec.c
    libavformat/redspark.c
    libavformat/replaygain.c
    libavformat/riff.c
    libavformat/riffdec.c
    libavformat/riffenc.c
    libavformat/rl2.c
    libavformat/rm.c
    libavformat/rmdec.c
    libavformat/rmenc.c
    libavformat/rmsipr.c
    libavformat/rpl.c
    libavformat/rsd.c
    libavformat/rso.c
    libavformat/rsodec.c
    libavformat/rsoenc.c
    libavformat/rtmpdigest.c
    libavformat/rtmphttp.c
    libavformat/rtmppkt.c
    libavformat/rtmpproto.c
    libavformat/rtp.c
    libavformat/rtpdec.c
    libavformat/rtpdec_ac3.c
    libavformat/rtpdec_amr.c
    libavformat/rtpdec_asf.c
    libavformat/rtpdec_dv.c
    libavformat/rtpdec_g726.c
    libavformat/rtpdec_h261.c
    libavformat/rtpdec_h263.c
    libavformat/rtpdec_h263_rfc2190.c
    libavformat/rtpdec_h264.c
    libavformat/rtpdec_hevc.c
    libavformat/rtpdec_ilbc.c
    libavformat/rtpdec_jpeg.c
    libavformat/rtpdec_latm.c
    libavformat/rtpdec_mpa_robust.c
    libavformat/rtpdec_mpeg12.c
    libavformat/rtpdec_mpeg4.c
    libavformat/rtpdec_mpegts.c
    libavformat/rtpdec_qcelp.c
    libavformat/rtpdec_qdm2.c
    libavformat/rtpdec_qt.c
    libavformat/rtpdec_rfc4175.c
    libavformat/rtpdec_svq3.c
    libavformat/rtpdec_vc2hq.c
    libavformat/rtpdec_vp8.c
    libavformat/rtpdec_vp9.c
    libavformat/rtpdec_xiph.c
    libavformat/rtpenc.c
    libavformat/rtpenc_aac.c
    libavformat/rtpenc_amr.c
    libavformat/rtpenc_chain.c
    libavformat/rtpenc_h261.c
    libavformat/rtpenc_h263.c
    libavformat/rtpenc_h263_rfc2190.c
    libavformat/rtpenc_h264_hevc.c
    libavformat/rtpenc_jpeg.c
    libavformat/rtpenc_latm.c
    libavformat/rtpenc_mpegts.c
    libavformat/rtpenc_mpv.c
    libavformat/rtpenc_vc2hq.c
    libavformat/rtpenc_vp8.c
    libavformat/rtpenc_vp9.c
    libavformat/rtpenc_xiph.c
    libavformat/rtpproto.c
    libavformat/rtsp.c
    libavformat/rtspdec.c
    libavformat/rtspenc.c
    libavformat/s337m.c
    libavformat/samidec.c
    libavformat/sapdec.c
    libavformat/sapenc.c
    libavformat/sauce.c
    libavformat/sbcdec.c
    libavformat/sbgdec.c
    libavformat/sccdec.c
    libavformat/sccenc.c
    libavformat/sdp.c
    libavformat/sdr2.c
    libavformat/sdsdec.c
    libavformat/sdxdec.c
    libavformat/segafilm.c
    libavformat/segafilmenc.c
    libavformat/segment.c
    libavformat/serdec.c
    libavformat/shortendec.c
    libavformat/sierravmd.c
    libavformat/siff.c
    libavformat/smacker.c
    libavformat/smjpeg.c
    libavformat/smjpegdec.c
    libavformat/smjpegenc.c
    libavformat/smoothstreamingenc.c
    libavformat/smush.c
    libavformat/sol.c
    libavformat/soxdec.c
    libavformat/soxenc.c
    libavformat/spdif.c
    libavformat/spdifdec.c
    libavformat/spdifenc.c
    libavformat/srtdec.c
    libavformat/srtenc.c
    libavformat/srtp.c
    libavformat/srtpproto.c
    libavformat/stldec.c
    libavformat/subfile.c
    libavformat/subtitles.c
    libavformat/subviewer1dec.c
    libavformat/subviewerdec.c
    libavformat/supdec.c
    libavformat/supenc.c
    libavformat/svag.c
    libavformat/swf.c
    libavformat/swfdec.c
    libavformat/swfenc.c
    libavformat/takdec.c
    libavformat/tcp.c
    libavformat/tedcaptionsdec.c
    libavformat/tee.c
    libavformat/tee_common.c
    libavformat/teeproto.c
    libavformat/thp.c
    libavformat/tiertexseq.c
    libavformat/tmv.c
    libavformat/tta.c
    libavformat/ttaenc.c
    libavformat/tty.c
    libavformat/txd.c
    libavformat/ty.c
    libavformat/udp.c
    libavformat/uncodedframecrcenc.c
    libavformat/unix.c
    libavformat/url.c
    libavformat/urldecode.c
    libavformat/utils.c
    libavformat/v210.c
    libavformat/vag.c
    libavformat/vc1dec.c
    libavformat/vc1test.c
    libavformat/vc1testenc.c
    libavformat/vivo.c
    libavformat/voc.c
    libavformat/voc_packet.c
    libavformat/vocdec.c
    libavformat/vocenc.c
    libavformat/vorbiscomment.c
    libavformat/vpcc.c
    libavformat/vpk.c
    libavformat/vplayerdec.c
    libavformat/vqf.c
    libavformat/w64.c
    libavformat/wavdec.c
    libavformat/wavenc.c
    libavformat/wc3movie.c
    libavformat/webm_chunk.c
    libavformat/webmdashenc.c
    libavformat/webpenc.c
    libavformat/webvttdec.c
    libavformat/webvttenc.c
    libavformat/westwood_aud.c
    libavformat/westwood_vqa.c
    libavformat/wsddec.c
    libavformat/wtv_common.c
    libavformat/wtvdec.c
    libavformat/wtvenc.c
    libavformat/wv.c
    libavformat/wvdec.c
    libavformat/wvedec.c
    libavformat/wvenc.c
    libavformat/xa.c
    libavformat/xmv.c
    libavformat/xvag.c
    libavformat/xwma.c
    libavformat/yop.c
    libavformat/yuv4mpegdec.c
    libavformat/yuv4mpegenc.c
)

list(APPEND avcodec_srcs
    libavcodec/012v.c
    libavcodec/4xm.c
    libavcodec/8bps.c
    libavcodec/8svx.c
    libavcodec/a64multienc.c
    libavcodec/aac_ac3_parser.c
    libavcodec/aac_adtstoasc_bsf.c
    libavcodec/aac_parser.c
    libavcodec/aaccoder.c
    libavcodec/aacdec.c
    libavcodec/aacdec_fixed.c
    libavcodec/aacenc.c
    libavcodec/aacenc_is.c
    libavcodec/aacenc_ltp.c
    libavcodec/aacenc_pred.c
    libavcodec/aacenc_tns.c
    libavcodec/aacenctab.c
    libavcodec/aacps_fixed.c
    libavcodec/aacps_float.c
    libavcodec/aacpsdsp_fixed.c
    libavcodec/aacpsdsp_float.c
    libavcodec/aacpsy.c
    libavcodec/aacsbr.c
    libavcodec/aacsbr_fixed.c
    libavcodec/aactab.c
    libavcodec/aandcttab.c
    libavcodec/aasc.c
    libavcodec/ac3.c
    libavcodec/ac3_parser.c
    libavcodec/ac3dec_data.c
    libavcodec/ac3dec_fixed.c
    libavcodec/ac3dec_float.c
    libavcodec/ac3dsp.c
    libavcodec/ac3enc.c
    libavcodec/ac3enc_fixed.c
    libavcodec/ac3enc_float.c
    libavcodec/ac3tab.c
    libavcodec/acelp_filters.c
    libavcodec/acelp_pitch_delay.c
    libavcodec/acelp_vectors.c
    libavcodec/adpcm.c
    libavcodec/adpcm_data.c
    libavcodec/adpcmenc.c
    libavcodec/adts_header.c
    libavcodec/adts_parser.c
    libavcodec/adx.c
    libavcodec/adx_parser.c
    libavcodec/adxdec.c
    libavcodec/adxenc.c
    libavcodec/aic.c
    libavcodec/alac.c
    libavcodec/alac_data.c
    libavcodec/alacdsp.c
    libavcodec/alacenc.c
    libavcodec/aliaspixdec.c
    libavcodec/aliaspixenc.c
    libavcodec/allcodecs.c
    libavcodec/alsdec.c
    libavcodec/amrnbdec.c
    libavcodec/amrwbdec.c
    libavcodec/anm.c
    libavcodec/ansi.c
    libavcodec/apedec.c
    libavcodec/aptx.c
    libavcodec/ass.c
    libavcodec/ass_split.c
    libavcodec/assdec.c
    libavcodec/assenc.c
    libavcodec/asv.c
    libavcodec/asvdec.c
    libavcodec/asvenc.c
    libavcodec/atrac.c
    libavcodec/atrac1.c
    libavcodec/atrac3.c
    libavcodec/atrac3plus.c
    libavcodec/atrac3plusdec.c
    libavcodec/atrac3plusdsp.c
    libavcodec/atrac9dec.c
    libavcodec/audio_frame_queue.c
    libavcodec/audiodsp.c
    libavcodec/aura.c
    libavcodec/av1_metadata_bsf.c
    libavcodec/av1_parse.c
    libavcodec/av1_parser.c
    libavcodec/avdct.c
    libavcodec/avfft.c
    libavcodec/avpacket.c
    libavcodec/avpicture.c
    libavcodec/avrndec.c
    libavcodec/avs.c
    libavcodec/avs2_parser.c
    libavcodec/avuidec.c
    libavcodec/avuienc.c
    libavcodec/bethsoftvideo.c
    libavcodec/bfi.c
    libavcodec/bgmc.c
    libavcodec/bink.c
    libavcodec/binkaudio.c
    libavcodec/binkdsp.c
    libavcodec/bintext.c
    libavcodec/bitpacked.c
    libavcodec/bitstream.c
    libavcodec/bitstream_filter.c
    libavcodec/bitstream_filters.c
    libavcodec/blockdsp.c
    libavcodec/bmp.c
    libavcodec/bmp_parser.c
    libavcodec/bmpenc.c
    libavcodec/bmvaudio.c
    libavcodec/bmvvideo.c
    libavcodec/brenderpix.c
    libavcodec/bsf.c
    libavcodec/bswapdsp.c
    libavcodec/c93.c
    libavcodec/cabac.c
    libavcodec/canopus.c
    libavcodec/cavs.c
    libavcodec/cavs_parser.c
    libavcodec/cavsdata.c
    libavcodec/cavsdec.c
    libavcodec/cavsdsp.c
    libavcodec/cbrt_data.c
    libavcodec/cbrt_data_fixed.c
    libavcodec/cbs.c
    libavcodec/cbs_av1.c
    libavcodec/cbs_h2645.c
    libavcodec/cbs_mpeg2.c
    libavcodec/cbs_vp9.c
    libavcodec/ccaption_dec.c
    libavcodec/cdgraphics.c
    libavcodec/cdxl.c
    libavcodec/celp_filters.c
    libavcodec/celp_math.c
    libavcodec/cfhd.c
    libavcodec/cfhddata.c
    libavcodec/cga_data.c
    libavcodec/chomp_bsf.c
    libavcodec/cinepak.c
    libavcodec/cinepakenc.c
    libavcodec/clearvideo.c
    libavcodec/cljrdec.c
    libavcodec/cljrenc.c
    libavcodec/cllc.c
    libavcodec/cngdec.c
    libavcodec/cngenc.c
    libavcodec/codec2utils.c
    libavcodec/codec_desc.c
    libavcodec/cook.c
    libavcodec/cook_parser.c
    libavcodec/cpia.c
    libavcodec/cscd.c
    libavcodec/cyuv.c
    libavcodec/d3d11va.c
    libavcodec/dca.c
    libavcodec/dca_core.c
    libavcodec/dca_core_bsf.c
    libavcodec/dca_exss.c
    libavcodec/dca_lbr.c
    libavcodec/dca_parser.c
    libavcodec/dca_xll.c
    libavcodec/dcaadpcm.c
    libavcodec/dcadata.c
    libavcodec/dcadct.c
    libavcodec/dcadec.c
    libavcodec/dcadsp.c
    libavcodec/dcaenc.c
    libavcodec/dcahuff.c
    libavcodec/dct.c
    libavcodec/dct32_fixed.c
    libavcodec/dct32_float.c
    libavcodec/dds.c
    libavcodec/decode.c
    libavcodec/dfa.c
    libavcodec/dirac.c
    libavcodec/dirac_arith.c
    libavcodec/dirac_dwt.c
    libavcodec/dirac_parser.c
    libavcodec/dirac_vlc.c
    libavcodec/diracdec.c
    libavcodec/diracdsp.c
    libavcodec/diractab.c
    libavcodec/dnxhd_parser.c
    libavcodec/dnxhddata.c
    libavcodec/dnxhddec.c
    libavcodec/dnxhdenc.c
    libavcodec/dolby_e.c
    libavcodec/dpcm.c
    libavcodec/dpx.c
    libavcodec/dpx_parser.c
    libavcodec/dpxenc.c
    libavcodec/dsd.c
    libavcodec/dsddec.c
    libavcodec/dsicinaudio.c
    libavcodec/dsicinvideo.c
    libavcodec/dss_sp.c
    libavcodec/dstdec.c
    libavcodec/dump_extradata_bsf.c
    libavcodec/dv.c
    libavcodec/dv_profile.c
    libavcodec/dvaudio_parser.c
    libavcodec/dvaudiodec.c
    libavcodec/dvbsub.c
    libavcodec/dvbsub_parser.c
    libavcodec/dvbsubdec.c
    libavcodec/dvd_nav_parser.c
    libavcodec/dvdata.c
    libavcodec/dvdec.c
    libavcodec/dvdsub_parser.c
    libavcodec/dvdsubdec.c
    libavcodec/dvdsubenc.c
    libavcodec/dvenc.c
    libavcodec/dxa.c
    libavcodec/dxtory.c
    libavcodec/dxv.c
    libavcodec/eac3_core_bsf.c
    libavcodec/eac3_data.c
    libavcodec/eac3enc.c
    libavcodec/eacmv.c
    libavcodec/eaidct.c
    libavcodec/eamad.c
    libavcodec/eatgq.c
    libavcodec/eatgv.c
    libavcodec/eatqi.c
    libavcodec/elbg.c
    libavcodec/elsdec.c
    libavcodec/encode.c
    libavcodec/error_resilience.c
    libavcodec/escape124.c
    libavcodec/escape130.c
    libavcodec/evrcdec.c
    libavcodec/exif.c
    libavcodec/exr.c
    libavcodec/exrdsp.c
    libavcodec/extract_extradata_bsf.c
    libavcodec/faandct.c
    libavcodec/faanidct.c
    libavcodec/faxcompr.c
    libavcodec/fdctdsp.c
    libavcodec/fft_fixed.c
    libavcodec/fft_fixed_32.c
    libavcodec/fft_float.c
    libavcodec/fft_init_table.c
    libavcodec/ffv1.c
    libavcodec/ffv1dec.c
    libavcodec/ffv1enc.c
    libavcodec/ffwavesynth.c
    libavcodec/fic.c
    libavcodec/filter_units_bsf.c
    libavcodec/fits.c
    libavcodec/fitsdec.c
    libavcodec/fitsenc.c
    libavcodec/flac.c
    libavcodec/flac_parser.c
    libavcodec/flacdata.c
    libavcodec/flacdec.c
    libavcodec/flacdsp.c
    libavcodec/flacenc.c
    libavcodec/flashsv.c
    libavcodec/flashsv2enc.c
    libavcodec/flashsvenc.c
    libavcodec/flicvideo.c
    libavcodec/flvdec.c
    libavcodec/flvenc.c
    libavcodec/fmtconvert.c
    libavcodec/fmvc.c
    libavcodec/frame_thread_encoder.c
    libavcodec/fraps.c
    libavcodec/frwu.c
    libavcodec/g2meet.c
    libavcodec/g722.c
    libavcodec/g722dec.c
    libavcodec/g722dsp.c
    libavcodec/g722enc.c
    libavcodec/g723_1.c
    libavcodec/g723_1dec.c
    libavcodec/g723_1enc.c
    libavcodec/g726.c
    libavcodec/g729_parser.c
    libavcodec/g729dec.c
    libavcodec/g729postfilter.c
    libavcodec/gdv.c
    libavcodec/gif.c
    libavcodec/gifdec.c
    libavcodec/golomb.c
    libavcodec/gsm_parser.c
    libavcodec/gsmdec.c
    libavcodec/gsmdec_data.c
    libavcodec/h261.c
    libavcodec/h261_parser.c
    libavcodec/h261data.c
    libavcodec/h261dec.c
    libavcodec/h261enc.c
    libavcodec/h263.c
    libavcodec/h263_parser.c
    libavcodec/h263data.c
    libavcodec/h263dec.c
    libavcodec/h263dsp.c
    libavcodec/h2645_parse.c
    libavcodec/h264_cabac.c
    libavcodec/h264_cavlc.c
    libavcodec/h264_direct.c
    libavcodec/h264_levels.c
    libavcodec/h264_loopfilter.c
    libavcodec/h264_mb.c
    libavcodec/h264_metadata_bsf.c
    libavcodec/h264_mp4toannexb_bsf.c
    libavcodec/h264_parse.c
    libavcodec/h264_parser.c
    libavcodec/h264_picture.c
    libavcodec/h264_ps.c
    libavcodec/h264_redundant_pps_bsf.c
    libavcodec/h264_refs.c
    libavcodec/h264_sei.c
    libavcodec/h264_slice.c
    libavcodec/h264chroma.c
    libavcodec/h264data.c
    libavcodec/h264dec.c
    libavcodec/h264dsp.c
    libavcodec/h264idct.c
    libavcodec/h264pred.c
    libavcodec/h264qpel.c
    libavcodec/h265_metadata_bsf.c
    libavcodec/hap.c
    libavcodec/hapdec.c
    libavcodec/hapqa_extract_bsf.c
    libavcodec/hevc_cabac.c
    libavcodec/hevc_data.c
    libavcodec/hevc_filter.c
    libavcodec/hevc_mp4toannexb_bsf.c
    libavcodec/hevc_mvs.c
    libavcodec/hevc_parse.c
    libavcodec/hevc_parser.c
    libavcodec/hevc_ps.c
    libavcodec/hevc_refs.c
    libavcodec/hevc_sei.c
    libavcodec/hevcdec.c
    libavcodec/hevcdsp.c
    libavcodec/hevcpred.c
    libavcodec/hnm4video.c
    libavcodec/hpeldsp.c
    libavcodec/hq_hqa.c
    libavcodec/hq_hqadata.c
    libavcodec/hq_hqadsp.c
    libavcodec/hqx.c
    libavcodec/hqxdsp.c
    libavcodec/hqxvlc.c
    libavcodec/htmlsubtitles.c
    libavcodec/huffman.c
    libavcodec/huffyuv.c
    libavcodec/huffyuvdec.c
    libavcodec/huffyuvdsp.c
    libavcodec/huffyuvenc.c
    libavcodec/huffyuvencdsp.c
    libavcodec/idcinvideo.c
    libavcodec/idctdsp.c
    libavcodec/iff.c
    libavcodec/iirfilter.c
    libavcodec/ilbcdec.c
    libavcodec/imc.c
    libavcodec/imgconvert.c
    libavcodec/imm4.c
    libavcodec/imx_dump_header_bsf.c
    libavcodec/indeo2.c
    libavcodec/indeo3.c
    libavcodec/indeo4.c
    libavcodec/indeo5.c
    libavcodec/intelh263dec.c
    libavcodec/interplayacm.c
    libavcodec/interplayvideo.c
    libavcodec/intrax8.c
    libavcodec/intrax8dsp.c
    libavcodec/ituh263dec.c
    libavcodec/ituh263enc.c
    libavcodec/ivi.c
    libavcodec/ivi_dsp.c
    libavcodec/j2kenc.c
    libavcodec/jacosubdec.c
    libavcodec/jfdctfst.c
    libavcodec/jfdctint.c
    libavcodec/jni.c
    libavcodec/jpeg2000.c
    libavcodec/jpeg2000dec.c
    libavcodec/jpeg2000dsp.c
    libavcodec/jpeg2000dwt.c
    libavcodec/jpegls.c
    libavcodec/jpeglsdec.c
    libavcodec/jpeglsenc.c
    libavcodec/jpegtables.c
    libavcodec/jrevdct.c
    libavcodec/jvdec.c
    libavcodec/kbdwin.c
    libavcodec/kgv1dec.c
    libavcodec/kmvc.c
    libavcodec/lagarith.c
    libavcodec/lagarithrac.c
    libavcodec/latm_parser.c
    libavcodec/lcldec.c
    libavcodec/lclenc.c
    libavcodec/libfdk-aacdec.c
    libavcodec/libfdk-aacenc.c
    libavcodec/libx264.c
    libavcodec/ljpegenc.c
    libavcodec/loco.c
    libavcodec/lossless_audiodsp.c
    libavcodec/lossless_videodsp.c
    libavcodec/lossless_videoencdsp.c
    libavcodec/lpc.c
    libavcodec/lsp.c
    libavcodec/lzf.c
    libavcodec/lzw.c
    libavcodec/lzwenc.c
    libavcodec/m101.c
    libavcodec/mace.c
    libavcodec/magicyuv.c
    libavcodec/magicyuvenc.c
    libavcodec/mathtables.c
    libavcodec/mdct15.c
    libavcodec/mdct_fixed.c
    libavcodec/mdct_fixed_32.c
    libavcodec/mdct_float.c
    libavcodec/mdec.c
    libavcodec/me_cmp.c
    libavcodec/mediacodec.c
    libavcodec/metasound.c
    libavcodec/metasound_data.c
    libavcodec/microdvddec.c
    libavcodec/mimic.c
    libavcodec/mjpeg2jpeg_bsf.c
    libavcodec/mjpeg_parser.c
    libavcodec/mjpega_dump_header_bsf.c
    libavcodec/mjpegbdec.c
    libavcodec/mjpegdec.c
    libavcodec/mjpegenc.c
    libavcodec/mjpegenc_common.c
    libavcodec/mjpegenc_huffman.c
    libavcodec/mlp.c
    libavcodec/mlp_parser.c
    libavcodec/mlpdec.c
    libavcodec/mlpdsp.c
    libavcodec/mlpenc.c
    libavcodec/mlz.c
    libavcodec/mmvideo.c
    libavcodec/motion_est.c
    libavcodec/motionpixels.c
    libavcodec/movsub_bsf.c
    libavcodec/movtextdec.c
    libavcodec/movtextenc.c
    libavcodec/mp3_header_decompress_bsf.c
    libavcodec/mpc.c
    libavcodec/mpc7.c
    libavcodec/mpc8.c
    libavcodec/mpeg12.c
    libavcodec/mpeg12data.c
    libavcodec/mpeg12dec.c
    libavcodec/mpeg12enc.c
    libavcodec/mpeg12framerate.c
    libavcodec/mpeg2_metadata_bsf.c
    libavcodec/mpeg4_unpack_bframes_bsf.c
    libavcodec/mpeg4audio.c
    libavcodec/mpeg4video.c
    libavcodec/mpeg4video_parser.c
    libavcodec/mpeg4videodec.c
    libavcodec/mpeg4videoenc.c
    libavcodec/mpeg_er.c
    libavcodec/mpegaudio.c
    libavcodec/mpegaudio_parser.c
    libavcodec/mpegaudiodata.c
    libavcodec/mpegaudiodec_fixed.c
    libavcodec/mpegaudiodec_float.c
    libavcodec/mpegaudiodecheader.c
    libavcodec/mpegaudiodsp.c
    libavcodec/mpegaudiodsp_data.c
    libavcodec/mpegaudiodsp_fixed.c
    libavcodec/mpegaudiodsp_float.c
    libavcodec/mpegaudioenc_fixed.c
    libavcodec/mpegaudioenc_float.c
    libavcodec/mpegpicture.c
    libavcodec/mpegutils.c
    libavcodec/mpegvideo.c
    libavcodec/mpegvideo_enc.c
    libavcodec/mpegvideo_motion.c
    libavcodec/mpegvideo_parser.c
    libavcodec/mpegvideodata.c
    libavcodec/mpegvideodsp.c
    libavcodec/mpegvideoencdsp.c
    libavcodec/mpl2dec.c
    libavcodec/mqc.c
    libavcodec/mqcdec.c
    libavcodec/mqcenc.c
    libavcodec/mscc.c
    libavcodec/msgsmdec.c
    libavcodec/msmpeg4.c
    libavcodec/msmpeg4data.c
    libavcodec/msmpeg4dec.c
    libavcodec/msmpeg4enc.c
    libavcodec/msrle.c
    libavcodec/msrledec.c
    libavcodec/mss1.c
    libavcodec/mss12.c
    libavcodec/mss2.c
    libavcodec/mss2dsp.c
    libavcodec/mss3.c
    libavcodec/mss34dsp.c
    libavcodec/mss4.c
    libavcodec/msvideo1.c
    libavcodec/msvideo1enc.c
    libavcodec/mvcdec.c
    libavcodec/mwsc.c
    libavcodec/mxpegdec.c
    libavcodec/nellymoser.c
    libavcodec/nellymoserdec.c
    libavcodec/nellymoserenc.c
    libavcodec/noise_bsf.c
    libavcodec/null_bsf.c
    libavcodec/nuv.c
    libavcodec/on2avc.c
    libavcodec/on2avcdata.c
    libavcodec/options.c
    libavcodec/opus.c
    libavcodec/opus_celt.c
    libavcodec/opus_parser.c
    libavcodec/opus_pvq.c
    libavcodec/opus_rc.c
    libavcodec/opus_silk.c
    libavcodec/opusdec.c
    libavcodec/opusenc.c
    libavcodec/opusenc_psy.c
    libavcodec/opustab.c
    libavcodec/pafaudio.c
    libavcodec/pafvideo.c
    libavcodec/pamenc.c
    libavcodec/parser.c
    libavcodec/parsers.c
    libavcodec/pcm-bluray.c
    libavcodec/pcm-dvd.c
    libavcodec/pcm.c
    libavcodec/pcx.c
    libavcodec/pcxenc.c
    libavcodec/pgssubdec.c
    libavcodec/pictordec.c
    libavcodec/pixblockdsp.c
    libavcodec/pixlet.c
    libavcodec/png.c
    libavcodec/png_parser.c
    libavcodec/pngdec.c
    libavcodec/pngdsp.c
    libavcodec/pngenc.c
    libavcodec/pnm.c
    libavcodec/pnm_parser.c
    libavcodec/pnmdec.c
    libavcodec/pnmenc.c
    libavcodec/profiles.c
    libavcodec/proresdata.c
    libavcodec/proresdec2.c
    libavcodec/proresdsp.c
    libavcodec/proresenc_anatoliy.c
    libavcodec/proresenc_kostya.c
    libavcodec/prosumer.c
    libavcodec/psd.c
    libavcodec/psymodel.c
    libavcodec/pthread.c
    libavcodec/pthread_frame.c
    libavcodec/pthread_slice.c
    libavcodec/ptx.c
    libavcodec/qcelpdec.c
    libavcodec/qdm2.c
    libavcodec/qdmc.c
    libavcodec/qdrw.c
    libavcodec/qpeg.c
    libavcodec/qpeldsp.c
    libavcodec/qsv_api.c
    libavcodec/qtrle.c
    libavcodec/qtrleenc.c
    libavcodec/r210dec.c
    libavcodec/r210enc.c
    libavcodec/ra144.c
    libavcodec/ra144dec.c
    libavcodec/ra144enc.c
    libavcodec/ra288.c
    libavcodec/ralf.c
    libavcodec/rangecoder.c
    libavcodec/rasc.c
    libavcodec/ratecontrol.c
    libavcodec/raw.c
    libavcodec/rawdec.c
    libavcodec/rawenc.c
    libavcodec/rdft.c
    libavcodec/realtextdec.c
    libavcodec/remove_extradata_bsf.c
    libavcodec/rl.c
    libavcodec/rl2.c
    libavcodec/rle.c
    libavcodec/roqaudioenc.c
    libavcodec/roqvideo.c
    libavcodec/roqvideodec.c
    libavcodec/roqvideoenc.c
    libavcodec/rpza.c
    libavcodec/rscc.c
    libavcodec/rtjpeg.c
    libavcodec/rv10.c
    libavcodec/rv10enc.c
    libavcodec/rv20enc.c
    libavcodec/rv30.c
    libavcodec/rv30dsp.c
    libavcodec/rv34.c
    libavcodec/rv34_parser.c
    libavcodec/rv34dsp.c
    libavcodec/rv40.c
    libavcodec/rv40dsp.c
    libavcodec/s302m.c
    libavcodec/s302menc.c
    libavcodec/samidec.c
    libavcodec/sanm.c
    libavcodec/sbc.c
    libavcodec/sbc_parser.c
    libavcodec/sbcdec.c
    libavcodec/sbcdec_data.c
    libavcodec/sbcdsp.c
    libavcodec/sbcdsp_data.c
    libavcodec/sbcenc.c
    libavcodec/sbrdsp.c
    libavcodec/sbrdsp_fixed.c
    libavcodec/scpr.c
    libavcodec/screenpresso.c
    libavcodec/sgidec.c
    libavcodec/sgienc.c
    libavcodec/sgirledec.c
    libavcodec/sheervideo.c
    libavcodec/shorten.c
    libavcodec/simple_idct.c
    libavcodec/sinewin.c
    libavcodec/sinewin_fixed.c
    libavcodec/sipr.c
    libavcodec/sipr16k.c
    libavcodec/sipr_parser.c
    libavcodec/smacker.c
    libavcodec/smc.c
    libavcodec/smvjpegdec.c
    libavcodec/snappy.c
    libavcodec/snow.c
    libavcodec/snow_dwt.c
    libavcodec/snowdec.c
    libavcodec/snowenc.c
    libavcodec/sonic.c
    libavcodec/sp5xdec.c
    libavcodec/speedhq.c
    libavcodec/srtdec.c
    libavcodec/srtenc.c
    libavcodec/startcode.c
    libavcodec/subviewerdec.c
    libavcodec/sunrast.c
    libavcodec/sunrastenc.c
    libavcodec/svq1.c
    libavcodec/svq13.c
    libavcodec/svq1dec.c
    libavcodec/svq1enc.c
    libavcodec/svq3.c
    libavcodec/synth_filter.c
    libavcodec/tak.c
    libavcodec/tak_parser.c
    libavcodec/takdec.c
    libavcodec/takdsp.c
    libavcodec/targa.c
    libavcodec/targa_y216dec.c
    libavcodec/targaenc.c
    libavcodec/tdsc.c
    libavcodec/textdec.c
    libavcodec/texturedsp.c
    libavcodec/tiertexseqv.c
    libavcodec/tiff.c
    libavcodec/tiff_common.c
    libavcodec/tiff_data.c
    libavcodec/tiffenc.c
    libavcodec/tmv.c
    libavcodec/tpeldsp.c
    libavcodec/trace_headers_bsf.c
    libavcodec/truemotion1.c
    libavcodec/truemotion2.c
    libavcodec/truemotion2rt.c
    libavcodec/truespeech.c
    libavcodec/tscc.c
    libavcodec/tscc2.c
    libavcodec/tta.c
    libavcodec/ttadata.c
    libavcodec/ttadsp.c
    libavcodec/ttaenc.c
    libavcodec/ttaencdsp.c
    libavcodec/twinvq.c
    libavcodec/twinvqdec.c
    libavcodec/txd.c
    libavcodec/ulti.c
    libavcodec/utils.c
    libavcodec/utvideo.c
    libavcodec/utvideodec.c
    libavcodec/utvideodsp.c
    libavcodec/utvideoenc.c
    libavcodec/v210dec.c
    libavcodec/v210enc.c
    libavcodec/v210x.c
    libavcodec/v308dec.c
    libavcodec/v308enc.c
    libavcodec/v408dec.c
    libavcodec/v408enc.c
    libavcodec/v410dec.c
    libavcodec/v410enc.c
    libavcodec/vb.c
    libavcodec/vble.c
    libavcodec/vc1.c
    libavcodec/vc1_block.c
    libavcodec/vc1_loopfilter.c
    libavcodec/vc1_mc.c
    libavcodec/vc1_parser.c
    libavcodec/vc1_pred.c
    libavcodec/vc1data.c
    libavcodec/vc1dec.c
    libavcodec/vc1dsp.c
    libavcodec/vc2enc.c
    libavcodec/vc2enc_dwt.c
    libavcodec/vcr1.c
    libavcodec/videodsp.c
    libavcodec/vima.c
    libavcodec/vmdaudio.c
    libavcodec/vmdvideo.c
    libavcodec/vmnc.c
    libavcodec/vorbis.c
    libavcodec/vorbis_data.c
    libavcodec/vorbis_parser.c
    libavcodec/vorbisdec.c
    libavcodec/vorbisdsp.c
    libavcodec/vorbisenc.c
    libavcodec/vp3.c
    libavcodec/vp3_parser.c
    libavcodec/vp3dsp.c
    libavcodec/vp5.c
    libavcodec/vp56.c
    libavcodec/vp56data.c
    libavcodec/vp56dsp.c
    libavcodec/vp56rac.c
    libavcodec/vp6.c
    libavcodec/vp6dsp.c
    libavcodec/vp8.c
    libavcodec/vp8_parser.c
    libavcodec/vp8dsp.c
    libavcodec/vp9.c
    libavcodec/vp9_metadata_bsf.c
    libavcodec/vp9_parser.c
    libavcodec/vp9_raw_reorder_bsf.c
    libavcodec/vp9_superframe_bsf.c
    libavcodec/vp9_superframe_split_bsf.c
    libavcodec/vp9block.c
    libavcodec/vp9data.c
    libavcodec/vp9dsp.c
    libavcodec/vp9dsp_10bpp.c
    libavcodec/vp9dsp_12bpp.c
    libavcodec/vp9dsp_8bpp.c
    libavcodec/vp9lpf.c
    libavcodec/vp9mvs.c
    libavcodec/vp9prob.c
    libavcodec/vp9recon.c
    libavcodec/vqavideo.c
    libavcodec/wavpack.c
    libavcodec/wavpackenc.c
    libavcodec/wcmv.c
    libavcodec/webp.c
    libavcodec/webvttdec.c
    libavcodec/webvttenc.c
    libavcodec/wma.c
    libavcodec/wma_common.c
    libavcodec/wma_freqs.c
    libavcodec/wmadec.c
    libavcodec/wmaenc.c
    libavcodec/wmalosslessdec.c
    libavcodec/wmaprodec.c
    libavcodec/wmavoice.c
    libavcodec/wmv2.c
    libavcodec/wmv2data.c
    libavcodec/wmv2dec.c
    libavcodec/wmv2dsp.c
    libavcodec/wmv2enc.c
    libavcodec/wnv1.c
    libavcodec/wrapped_avframe.c
    libavcodec/ws-snd1.c
    libavcodec/xan.c
    libavcodec/xbmdec.c
    libavcodec/xbmenc.c
    libavcodec/xface.c
    libavcodec/xfacedec.c
    libavcodec/xfaceenc.c
    libavcodec/xiph.c
    libavcodec/xl.c
    libavcodec/xma_parser.c
    libavcodec/xpmdec.c
    libavcodec/xsubdec.c
    libavcodec/xsubenc.c
    libavcodec/xvididct.c
    libavcodec/xwddec.c
    libavcodec/xwdenc.c
    libavcodec/xxan.c
    libavcodec/y41pdec.c
    libavcodec/y41penc.c
    libavcodec/ylc.c
    libavcodec/yop.c
    libavcodec/yuv4dec.c
    libavcodec/yuv4enc.c
    libavcodec/zerocodec.c
    libavcodec/zmbv.c
    libavcodec/zmbvenc.c
)

list(APPEND swresample_srcs
    libswresample/audioconvert.c
    libswresample/dither.c
    libswresample/options.c
    libswresample/rematrix.c
    libswresample/resample.c
    libswresample/resample_dsp.c
    libswresample/swresample.c
    libswresample/swresample_frame.c
)

list(APPEND swscale_srcs
    libswscale/alphablend.c
    libswscale/gamma.c
    libswscale/hscale.c
    libswscale/hscale_fast_bilinear.c
    libswscale/input.c
    libswscale/options.c
    libswscale/output.c
    libswscale/rgb2rgb.c
    libswscale/slice.c
    libswscale/swscale.c
    libswscale/swscale_unscaled.c
    libswscale/utils.c
    libswscale/vscale.c
    libswscale/yuv2rgb.c
)

list(APPEND avutil_srcs
    libavutil/adler32.c
    libavutil/aes.c
    libavutil/aes_ctr.c
    libavutil/audio_fifo.c
    libavutil/avstring.c
    libavutil/base64.c
    libavutil/blowfish.c
    libavutil/bprint.c
    libavutil/buffer.c
    libavutil/camellia.c
    libavutil/cast5.c
    libavutil/channel_layout.c
    libavutil/color_utils.c
    libavutil/cpu.c
    libavutil/crc.c
    libavutil/des.c
    libavutil/dict.c
    libavutil/display.c
    libavutil/downmix_info.c
    libavutil/encryption_info.c
    libavutil/error.c
    libavutil/eval.c
    libavutil/fifo.c
    libavutil/file.c
    libavutil/file_open.c
    libavutil/fixed_dsp.c
    libavutil/float_dsp.c
    libavutil/frame.c
    libavutil/hash.c
    libavutil/hmac.c
    libavutil/hwcontext.c
    libavutil/imgutils.c
    libavutil/integer.c
    libavutil/intmath.c
    libavutil/lfg.c
    libavutil/lls.c
    libavutil/log.c
    libavutil/log2_tab.c
    libavutil/lzo.c
    libavutil/mastering_display_metadata.c
    libavutil/mathematics.c
    libavutil/md5.c
    libavutil/mem.c
    libavutil/murmur3.c
    libavutil/opt.c
    libavutil/parseutils.c
    libavutil/pixdesc.c
    libavutil/pixelutils.c
    libavutil/random_seed.c
    libavutil/rational.c
    libavutil/rc4.c
    libavutil/reverse.c
    libavutil/ripemd.c
    libavutil/samplefmt.c
    libavutil/sha.c
    libavutil/sha512.c
    libavutil/slicethread.c
    libavutil/spherical.c
    libavutil/stereo3d.c
    libavutil/tea.c
    libavutil/threadmessage.c
    libavutil/time.c
    libavutil/timecode.c
    libavutil/tree.c
    libavutil/twofish.c
    libavutil/utils.c
    libavutil/xga_font_data.c
    libavutil/xtea.c
)

list(APPEND avdevice_srcs
    libavdevice/alldevices.c
    libavdevice/avdevice.c
    libavdevice/fbdev_common.c
    libavdevice/fbdev_dec.c
    libavdevice/fbdev_enc.c
    libavdevice/lavfi.c
    libavdevice/oss.c
    libavdevice/oss_dec.c
    libavdevice/oss_enc.c
    libavdevice/timefilter.c
    libavdevice/utils.c
    libavdevice/v4l2-common.c
    libavdevice/v4l2.c
    libavdevice/v4l2enc.c
    libavdevice/xcbgrab.c
)

list(APPEND ffmpeg_srcs
    fftools/ffmpeg_opt.c
    fftools/ffmpeg_filter.c
    fftools/ffmpeg_hw.c
    fftools/cmdutils.c
    fftools/ffmpeg.c
)

add_library(avfilter STATIC ${avfilter_srcs})
target_compile_definitions(avfilter PRIVATE BUILDING_avfilter)

add_library(avformat STATIC ${avformat_srcs})
target_compile_definitions(avformat PRIVATE DBUILDING_avformat)

add_library(avcodec STATIC ${avcodec_srcs})
target_compile_definitions(avcodec PRIVATE DBUILDING_avcodec)

add_library(postproc STATIC libpostproc/postprocess.c)
target_compile_definitions(postproc PRIVATE DBUILDING_postproc)

add_library(swresample STATIC ${swresample_srcs})
target_compile_definitions(swresample PRIVATE DBUILDING_swresample)

add_library(swscale STATIC ${swscale_srcs})
target_compile_definitions(swscale PRIVATE DBUILDING_swscale)

add_library(avutil STATIC ${avutil_srcs})
target_compile_definitions(avutil PRIVATE DBUILDING_avutil)

add_library(avdevice STATIC ${avdevice_srcs})
target_compile_definitions(avdevice PRIVATE DBUILDING_avdevice)


add_executable(ffmpeg ${ffmpeg_srcs})

target_link_libraries(ffmpeg
    postproc
    avformat
    avdevice
    avfilter
    avcodec
    swresample
    swscale
    avutil
)

target_link_libraries(ffmpeg
    -lx264
    -lfdk-aac
    -lm
    -lz
    -ldl
    -lpthread
    -lxcb
    -lXau
    -lxcb-shape
    -lxcb-xfixes
    -lxcb-render
    -llzma
    -lxcb-shm
)

add_subdirectory(ffmpeg-example)